#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    SECRET_KEY = os.environ.get(
        'SECRET_KEY') or 'chenbingwei'

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    DEBUG = True
    username = "postgres"
    password = os.environ.get(
        'PASSWORD') or "PASSWORD"
    hostname = "localhost"
    port = 5432
    db_name = "flask_erp_dev_10_01"
    DATABASE_URI = 'postgresql://{username}:{password}@{hostname}:{port}/{db_name}'.format(
        username=username, password=password, hostname=hostname, port=port, db_name=db_name)

    SQLALCHEMY_DATABASE_URI = os.environ.get(
        'DEV_DATABASE_URL') or DATABASE_URI
    SQLALCHEMY_TRACK_MODIFICATIONS = False


config = {
    'default': DevelopmentConfig,
    'development': DevelopmentConfig,
}
